<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>比较最大值</title>
</head>
<body>
    <script>
        function getMax(n1,n2){
            if(n1 > n2){
                return n1;
            }else{
                return n2;
            }
            return n1 > n2 ? n1 : n2;
        }
        document.write('6.98 和 6.99相比');
        document.write(getMax(6.98,6.99) +'最大');
        document.write("<br>")
        function getMax1(a,b,c){
            return(a > b ? a : b) > c ?( a > b ?a : b) : c
        }
        document.write('40, 70, 10相比')
        document.write(getMax1(40,70,10) + '最大'); 

    </script>
</body>
</html>